package com.yunhe.common.model.data;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

public class RunStrategyTemplateDetail {

    private Long id;
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date startTime;
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date endTime;
    private Long stageCode;
    private String stageTitle;
    private Long controlModeCode;
    private Double endSoc;
    private Integer power;
    private Double chargeRatioLimit;
    private Double chargeVoltage;
    private Double dischargeCurrent;
    private Double dischargeVoltageEnd;
    private Long tid;

    public Long getTid() {
        return tid;
    }

    public void setTid(Long tid) {
        this.tid = tid;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getStageTitle() {
        return stageTitle;
    }

    public void setStageTitle(String stageTitle) {
        this.stageTitle = stageTitle;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Long getStageCode() {
        return stageCode;
    }

    public void setStageCode(Long stageCode) {
        this.stageCode = stageCode;
    }

    public Long getControlModeCode() {
        return controlModeCode;
    }

    public void setControlModeCode(Long controlModeCode) {
        this.controlModeCode = controlModeCode;
    }

    public Double getEndSoc() {
        return endSoc;
    }

    public void setEndSoc(Double endSoc) {
        this.endSoc = endSoc;
    }

    public Integer getPower() {
        if (power != null) {
            return Math.abs(power);
        } else {
            return power;
        }
    }

    public void setPower(Integer power) {
        if (power != null) {
            int value = Math.abs(power);
            if (stageCode != null && stageCode == 1) {
                this.power = -value;
            } else {
                this.power = power;
            }
        } else {
            this.power = power;
        }
    }

    public Double getChargeRatioLimit() {
        return chargeRatioLimit;
    }

    public void setChargeRatioLimit(Double chargeRatioLimit) {
        this.chargeRatioLimit = chargeRatioLimit;
    }

    public Double getChargeVoltage() {
        return chargeVoltage;
    }

    public void setChargeVoltage(Double chargeVoltage) {
        this.chargeVoltage = chargeVoltage;
    }

    public Double getDischargeCurrent() {
        return dischargeCurrent;
    }

    public void setDischargeCurrent(Double dischargeCurrent) {
        this.dischargeCurrent = dischargeCurrent;
    }

    public Double getDischargeVoltageEnd() {
        return dischargeVoltageEnd;
    }

    public void setDischargeVoltageEnd(Double dischargeVoltageEnd) {
        this.dischargeVoltageEnd = dischargeVoltageEnd;
    }
}
